package com.itrus.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexUtils
{
  public static String exceptMatches(String paramString1, String paramString2)
  {
    return Pattern.compile(paramString2).matcher(paramString1).replaceAll("");
  }

  public static String exceptMatchesIgnoreCase(String paramString1, String paramString2)
  {
    return Pattern.compile(paramString2, 2).matcher(paramString1).replaceAll("");
  }

  public static boolean matches(String paramString1, String paramString2)
  {
    return Pattern.compile(paramString2).matcher(paramString1).matches();
  }

  public static boolean matchesIgnoreCase(String paramString1, String paramString2)
  {
    return Pattern.compile(paramString2, 2).matcher(paramString1).matches();
  }

  public static String replaceAllIgnoreCase(String paramString1, String paramString2, String paramString3)
  {
    return Pattern.compile(paramString2, 2).matcher(paramString1).replaceAll(paramString3);
  }

  public static String replaceFirstIgnoreCase(String paramString1, String paramString2, String paramString3)
  {
    return Pattern.compile(paramString2, 2).matcher(paramString1).replaceFirst(paramString3);
  }

  public static String replaceLast(String paramString1, String paramString2, String paramString3)
  {
    Pattern localPattern = Pattern.compile(paramString2);
    Matcher localMatcher1 = localPattern.matcher(paramString1);
    for (int i = -1; ; i = localMatcher1.start())
      if (!localMatcher1.find())
      {
        if (i != -1)
          break;
        return paramString1;
      }
    String str = paramString1.substring(0, i);
    Matcher localMatcher2 = localPattern.matcher(paramString1.substring(i));
    return str + localMatcher2.replaceFirst(paramString3);
  }

  public static String replaceLastIgnoreCase(String paramString1, String paramString2, String paramString3)
  {
    Pattern localPattern = Pattern.compile(paramString2, 2);
    Matcher localMatcher1 = localPattern.matcher(paramString1);
    for (int i = -1; ; i = localMatcher1.start())
      if (!localMatcher1.find())
      {
        if (i != -1)
          break;
        return paramString1;
      }
    String str = paramString1.substring(0, i);
    Matcher localMatcher2 = localPattern.matcher(paramString1.substring(i));
    return str + localMatcher2.replaceFirst(paramString3);
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.util.RegexUtils
 * JD-Core Version:    0.6.2
 */